package com.config;

import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

/**
 * @author chengyadong
 * @date 2023/9/17 15:42
 * @description 容器准备完成后监听器
 */
@Component
public class ContextReadyApplicationEvent implements ApplicationListener {
	@Override
	public void onApplicationEvent(ApplicationEvent event) {
		if(event instanceof ApplicationReadyEvent){
			System.out.println("容器准备好了");
		}
	}
}
